edu.stanford.smi.protege.server
Class Server
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
edu.stanford.smi.protege.server.Server
- All Implemented Interfaces:
- RemoteServer, Serializable, Remote
public class Server
- extends UnicastRemoteObject
- implements RemoteServer
- See Also:
- Serialized Form
|
Method Summary |
boolean |
allowsCreateUsers()
|
protected void |
bindName()
|
boolean |
cancelShutdownProject(RemoteSession session,
String projectName)
|
RemoteSession |
cloneSession(RemoteSession session)
|
void |
closeSession(RemoteSession session)
|
RemoteServerProject |
createProject(String newProjectName,
RemoteSession session,
KnowledgeBaseFactory kbfactory,
boolean saveToMetaProject)
|
boolean |
createUser(String userName,
String password)
|
void |
disconnectFromProject(RemoteServerProject serverProject,
RemoteSession session)
|
Object |
executeServerJob(ServerJob job,
RemoteSession session)
|
protected void |
extractMetaProjectLocation(String s)
|
Collection<Operation> |
getAllowedOperations(RemoteSession session,
String projectName,
String userName)
|
Collection<String> |
getAllProjectNames()
|
Collection<ProjectInfo> |
getAvailableProjectInfo(RemoteSession session)
|
Collection<String> |
getAvailableProjectNames(RemoteSession session)
|
static String |
getBoundName()
|
Collection<ServerProject> |
getCurrentProjects(RemoteSession session)
|
Collection<RemoteSession> |
getCurrentSessions()
|
Collection<RemoteSession> |
getCurrentSessions(RemoteServerProject project)
|
Collection<RemoteSession> |
getCurrentSessions(String projectName,
RemoteSession session)
|
static Server |
getInstance()
|
protected static String |
getLocalBoundName()
|
KnowledgeBase |
getMetaProject()
Deprecated. In ProtegeJobs use getMetaProjectInstance |
MetaProject |
getMetaProjectNew()
|
Slot |
getNameSlot()
Deprecated. In ProtegeJobs use getMetaProjectInstance |
Project |
getOrCreateProject(String name)
|
static Policy |
getPolicy()
|
Project |
getProject(String name)
|
Cls |
getProjectCls()
Deprecated. In ProtegeJobs use getMetaProjectInstance |
Map<String,ServerProject.ProjectStatus> |
getProjectsStatusMap()
|
ServerProject.ProjectStatus |
getProjectStatus(String name)
|
int |
getSaveIntervalMsec()
|
ServerProject |
getServerProject(Project p)
|
ServerProject |
getServerProject(String projectName)
|
boolean |
hasValidCredentials(String userName,
String password)
|
boolean |
isActive(RemoteSession session)
|
boolean |
isGroupOperationAllowed(RemoteSession session,
Operation op,
String groupName)
|
boolean |
isOperationAllowed(RemoteSession session,
Operation op,
String projectName)
|
boolean |
isServerOperationAllowed(RemoteSession session,
Operation op)
|
boolean |
isServerOperationAllowed(RemoteSession session,
Operation op,
String serverName)
|
void |
killOtherUserSession(RemoteSession sessionToKill,
RemoteSession session)
|
void |
killOtherUserSession(RemoteSession sessionToKill,
RemoteSession session,
int finalGracePeriod)
|
static void |
main(String[] args)
|
void |
notifyProject(String projectName,
String message,
RemoteSession session)
|
RemoteServerProject |
openMetaProject(RemoteSession session)
|
RemoteServerProject |
openProject(String projectName,
RemoteSession session)
|
RemoteSession |
openSession(String username,
String userIpAddress,
String password)
|
protected void |
parseArg(String arg)
|
protected void |
printUsage()
|
void |
reinitialize()
|
void |
saveAllProjects()
|
boolean |
saveMetaProject(RemoteSession session)
|
void |
setFrameCalculatorDisabled(boolean disabled)
|
void |
setProjectStatus(String name,
ServerProject.ProjectStatus status)
|
void |
setProjectStatus(String projectName,
ServerProject.ProjectStatus status,
RemoteSession session)
|
void |
setSaveIntervalMsec(int saveIntervalMsec)
|
void |
shutdown()
|
void |
shutdown(String projectName,
RemoteSession session)
|
void |
shutdownProject(RemoteSession session,
String projectName,
float warningTimeInSeconds)
Shuts down the remote project with the name projectName and sends shutdown notifications
at certain time periods: it starts with the warningTimeInSeconds argument and divides it by two. |
void |
shutdownProject(RemoteSession session,
String projectName,
Integer[] warningTimesInSeconds,
int finalGracePeriodInSeconds)
Shuts down the remote project with the name projectName and sends shutdown notifications
at time periods (in seconds) from the warningTimesInSeconds argument. |
static void |
startServer(String[] args)
Start up the server. |
String |
toString()
|
protected void |
unBindName()
|
NO_SAVE
public static final int NO_SAVE
- See Also:
- Constant Field Values
main
public static void main(String[] args)
startServer
public static void startServer(String[] args)
throws IOException
- Start up the server.
- Parameters:
args - the arguments to the serversf - the socket factory to be used
- Throws:
IOException - if the socket factory has already been set- See Also:
RMISocketFactory.setSocketFactory(RMISocketFactory)
getInstance
public static Server getInstance()
getPolicy
public static Policy getPolicy()
getBoundName
public static String getBoundName()
getLocalBoundName
protected static String getLocalBoundName()
getSaveIntervalMsec
public int getSaveIntervalMsec()
setSaveIntervalMsec
public void setSaveIntervalMsec(int saveIntervalMsec)
parseArg
protected void parseArg(String arg)
extractMetaProjectLocation
protected void extractMetaProjectLocation(String s)
printUsage
protected void printUsage()
bindName
protected void bindName()
throws RemoteException
- Throws:
RemoteException
unBindName
protected void unBindName()
throws RemoteException
- Throws:
RemoteException
getServerProject
public ServerProject getServerProject(String projectName)
getOrCreateProject
public Project getOrCreateProject(String name)
toString
public String toString()
- Overrides:
toString in class RemoteObject
saveMetaProject
public boolean saveMetaProject(RemoteSession session)
throws RemoteException
- Specified by:
saveMetaProject in interface RemoteServer
- Throws:
RemoteException
saveAllProjects
public void saveAllProjects()
isActive
public boolean isActive(RemoteSession session)
disconnectFromProject
public void disconnectFromProject(RemoteServerProject serverProject,
RemoteSession session)
throws ServerSessionLost
- Throws:
ServerSessionLost
getProject
public Project getProject(String name)
getServerProject
public ServerProject getServerProject(Project p)
getProjectStatus
public ServerProject.ProjectStatus getProjectStatus(String name)
- Specified by:
getProjectStatus in interface RemoteServer
setProjectStatus
public void setProjectStatus(String name,
ServerProject.ProjectStatus status)
getCurrentProjects
public Collection<ServerProject> getCurrentProjects(RemoteSession session)
getCurrentSessions
public Collection<RemoteSession> getCurrentSessions()
getCurrentSessions
public Collection<RemoteSession> getCurrentSessions(RemoteServerProject project)
setFrameCalculatorDisabled
public void setFrameCalculatorDisabled(boolean disabled)
getMetaProjectNew
public MetaProject getMetaProjectNew()
getMetaProject
@Deprecated
public KnowledgeBase getMetaProject()
- Deprecated. In ProtegeJobs use getMetaProjectInstance
getProjectCls
@Deprecated
public Cls getProjectCls()
- Deprecated. In ProtegeJobs use getMetaProjectInstance
getNameSlot
@Deprecated
public Slot getNameSlot()
- Deprecated. In ProtegeJobs use getMetaProjectInstance
reinitialize
public void reinitialize()
throws RemoteException
- Specified by:
reinitialize in interface RemoteServer
- Throws:
RemoteException
openSession
public RemoteSession openSession(String username,
String userIpAddress,
String password)
- Specified by:
openSession in interface RemoteServer
cloneSession
public RemoteSession cloneSession(RemoteSession session)
- Specified by:
cloneSession in interface RemoteServer
closeSession
public void closeSession(RemoteSession session)
- Specified by:
closeSession in interface RemoteServer
getCurrentSessions
public Collection<RemoteSession> getCurrentSessions(String projectName,
RemoteSession session)
- Specified by:
getCurrentSessions in interface RemoteServer
getAvailableProjectNames
public Collection<String> getAvailableProjectNames(RemoteSession session)
- Specified by:
getAvailableProjectNames in interface RemoteServer
getAvailableProjectInfo
public Collection<ProjectInfo> getAvailableProjectInfo(RemoteSession session)
- Specified by:
getAvailableProjectInfo in interface RemoteServer
getAllProjectNames
public Collection<String> getAllProjectNames()
getProjectsStatusMap
public Map<String,ServerProject.ProjectStatus> getProjectsStatusMap()
openProject
public RemoteServerProject openProject(String projectName,
RemoteSession session)
throws ServerSessionLost
- Specified by:
openProject in interface RemoteServer
- Throws:
ServerSessionLost
openMetaProject
public RemoteServerProject openMetaProject(RemoteSession session)
throws RemoteException
- Specified by:
openMetaProject in interface RemoteServer
- Throws:
RemoteException
createProject
public RemoteServerProject createProject(String newProjectName,
RemoteSession session,
KnowledgeBaseFactory kbfactory,
boolean saveToMetaProject)
throws RemoteException
- Specified by:
createProject in interface RemoteServer
- Throws:
RemoteException
setProjectStatus
public void setProjectStatus(String projectName,
ServerProject.ProjectStatus status,
RemoteSession session)
- Specified by:
setProjectStatus in interface RemoteServer
notifyProject
public void notifyProject(String projectName,
String message,
RemoteSession session)
- Specified by:
notifyProject in interface RemoteServer
createUser
public boolean createUser(String userName,
String password)
- Specified by:
createUser in interface RemoteServer
hasValidCredentials
public boolean hasValidCredentials(String userName,
String password)
- Specified by:
hasValidCredentials in interface RemoteServer
shutdown
public void shutdown()
- Specified by:
shutdown in interface RemoteServer
shutdown
public void shutdown(String projectName,
RemoteSession session)
- Specified by:
shutdown in interface RemoteServer
killOtherUserSession
public void killOtherUserSession(RemoteSession sessionToKill,
RemoteSession session)
- Specified by:
killOtherUserSession in interface RemoteServer
killOtherUserSession
public void killOtherUserSession(RemoteSession sessionToKill,
RemoteSession session,
int finalGracePeriod)
- Specified by:
killOtherUserSession in interface RemoteServer
shutdownProject
public void shutdownProject(RemoteSession session,
String projectName,
float warningTimeInSeconds)
throws RemoteException
- Shuts down the remote project with the name projectName and sends shutdown notifications
at certain time periods: it starts with the warningTimeInSeconds argument and divides it by two.
A
SecurityException is thrown if the user of the session does not
have the right to shutdown the project.
- Specified by:
shutdownProject in interface RemoteServer
- Parameters:
session - - the session that tries to shutdown the projectprojectName - - the remote project namewarningTimeInSeconds - - the time of the first notification in seconds
- Throws:
RemoteException
shutdownProject
public void shutdownProject(RemoteSession session,
String projectName,
Integer[] warningTimesInSeconds,
int finalGracePeriodInSeconds)
throws RemoteException
- Shuts down the remote project with the name projectName and sends shutdown notifications
at time periods (in seconds) from the warningTimesInSeconds argument.
A
SecurityException is thrown if the user of the session does not
have the right to shutdown the project.
- Specified by:
shutdownProject in interface RemoteServer
- Parameters:
session - - the session that tries to shutdown the projectprojectName - - the remote project namewarningTimesInSeconds - - a list of Integer with the notify periods of time in secondsfinalGracePeriodInSeconds - - the time the server will wait until shutting down the project after the last notification message
- Throws:
RemoteException
cancelShutdownProject
public boolean cancelShutdownProject(RemoteSession session,
String projectName)
- Specified by:
cancelShutdownProject in interface RemoteServer
allowsCreateUsers
public boolean allowsCreateUsers()
throws RemoteException
- Specified by:
allowsCreateUsers in interface RemoteServer
- Throws:
RemoteException
isOperationAllowed
public boolean isOperationAllowed(RemoteSession session,
Operation op,
String projectName)
- Specified by:
isOperationAllowed in interface RemoteServer
isServerOperationAllowed
public boolean isServerOperationAllowed(RemoteSession session,
Operation op)
- Specified by:
isServerOperationAllowed in interface RemoteServer
isServerOperationAllowed
public boolean isServerOperationAllowed(RemoteSession session,
Operation op,
String serverName)
- Specified by:
isServerOperationAllowed in interface RemoteServer
isGroupOperationAllowed
public boolean isGroupOperationAllowed(RemoteSession session,
Operation op,
String groupName)
- Specified by:
isGroupOperationAllowed in interface RemoteServer
getAllowedOperations
public Collection<Operation> getAllowedOperations(RemoteSession session,
String projectName,
String userName)
- Specified by:
getAllowedOperations in interface RemoteServer
executeServerJob
public Object executeServerJob(ServerJob job,
RemoteSession session)
- Specified by:
executeServerJob in interface RemoteServer
Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2012 Stanford University.